<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="language" content="en" />
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>

        <!-- Script -->
        <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery-1.7.1.min.js"></script>
        <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.isotope.min.js"></script>

        <!-- Stylesheet -->
        <link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/main.css" />
    </head>
    <body>
        <div id="header">
            <div id="header-content">
                <div id="top-bar">
                    <div class="wrapper">
                        <div id="logo">Plusia</div>
                        <div id="main-menu" <?php //if($actionId == 'index') echo "style='margin-left:-6px'";  ?>>
                            <?php
                            $this->widget('zii.widgets.CMenu', array(
                                'items' => array(
                                    array('label' => 'Trang chủ', 'url' => array('/site/index')),
                                    array('label' => 'Khám phá', 'url' => array('/site/explore')),
                                    array('label' => 'Album của tôi', 'url' => array('/site/MyAlbum'), 'visible' => !Yii::app()->user->isGuest),
                                    array('label' => 'Đăng nhập', 'url' => '#', 'visible' => Yii::app()->user->isGuest)
                                ),
                            ));
                            ?>
                        </div>
                        <div id="top-search-bar">
                            <input name="key" placeholder="Nhập từ khoá tìm kiếm..." id="search_top" <?PHP if (isset($_GET['key']))
                                echo 'value="' . $_GET['key'] . '"'; ?> type="text" />
                            <input type="submit" onclick="search_key()" value="Tìm" />
                        </div>
                        <button id="upload-button" type="button" class="btn">Upload</button>
                        <div id="login">
                            <?php
                            if (Yii::app()->user->isGuest == true) {
                                $model = new LoginForm();
                                $this->renderPartial("/site/login", array(
                                    'model' => $model,
                                    'visible' => false,
                                ));
                            } else {
                                ?>
                                <a class="login-link" href="index.php?r=site/MyAlbum">Album Của Tôi</a>&nbsp;|&nbsp;
                                <a class="login-link" href="index.php?r=site/logout">Đăng xuất!</a>
                            <?php } ?>
                        </div>
                        <script>
                            function search_key()
                            {
                                var key = $('#search_top').val();
                                window.location = 'index.php?r=site/explore&key='+key;
                            }
                        </script>
                    </div>
                </div>
            </div>
        </div>

        <div id="main">
            <div class="content-wrapper">
                <div id="main-content">
                    <?php echo $content; ?>
                </div>
            </div>
        </div>
        <div id="footer">
            <div class="wrapper">
                <div id="footer-content">
                    Copyright &copy; <?php echo date('Y'); ?> by My Company.<br/>
                    All Rights Reserved.<br/>
                    <?php echo Yii::powered(); ?>
                </div>
            </div>
        </div>
    </body>
</html>